<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:a4j="http://richfaces.org/a4j"
      xmlns:rich="http://richfaces.org/rich" >
    <h:head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <title>TODO supply a title</title>
        <script type="text/javascript">
            function updateCostItemName(code, name)
            {
                document.getElementById('proof:costcode').value = code;
                document.getElementById('proof:costname').value = name;
            }
            function showCostItem() {
                window.open("./page/pay/check/ecoList.jsf", "经济科目", "height=1024,width=800,toolbar=no,menubar=no,scrollbars=no");
            }
        </script>
        <style type="text/css">
            table.voucherGrid{
                border:1px solid #e2e2e2;
                border-collapse:collapse;
            }
            table.voucherGrid td{
                border:1px solid #e2e2e2;
            }
            .demo_fieldset {
                margin : 20px;
                border : 1px solid #ACBECE;
            }

            .demo_legend {
                font-weight : bold;
                margin : 0px 10px 0px 18px;
                font-family: Verdana;
            }
            .inputstype{
                width: 175px !important;
            }
            .pic{
                margin-bottom: -4px;
                margin-right: -2px;
                border:none;
                width:20px;
                height:20px;
            }
            .col1{
                width:80px;
                vertical-align: top;
            }
        </style>
    </h:head>
    <h:body>
        <h:form id="proof">
            <rich:panel header="支出证明单审核" styleClass="content-hight">
                <rich:messages globalOnly="true"/>
                <h:panelGrid columns="2">
                    <h:outputLabel value="单据状态:"/>
                    <h:panelGroup>
                        <h:outputText value="审核通过"  rendered="#{proofCheck.voucher.numberStatus == '2'}" style="color:blue"/>
                        <h:outputText value="退回修改"  rendered="#{proofCheck.voucher.numberStatus == '3'}" style="color:red"/>
                        <h:outputText value="等待审核"  rendered="#{proofCheck.voucher.numberStatus == '0'}" style="color:green"/>
                        <h:outputText value="支付成功"  rendered="#{proofCheck.voucher.numberStatus == '4'}" style="color:blue"/>
                        <h:outputText value="支付完毕"  rendered="#{proofCheck.voucher.numberStatus == '6'}" style="color:blue"/>
                    </h:panelGroup>
                </h:panelGrid>
                <rich:toolbar  itemSeparator="grida">
                    <rich:toolbarGroup>
                        <h:commandLink  action="#{proofCheck.checkandRep}"
                                        onclick="return confirm('确定通过？');"
                                        disabled="#{proofCheck.voucher.numberStatus != '0'}">
                            <h:graphicImage value="./images/check.png" styleClass="pic" title="通过" />
                        </h:commandLink>
                        <h:commandLink  action="#{proofCheck.back}"
                                        onclick="return confirm('确定退回？');"
                                        disabled="#{proofCheck.voucher.numberStatus != '0'}">
                            <h:graphicImage value="./images/return.png" styleClass="pic" title="退回" />
                        </h:commandLink>
                        <h:commandLink  action="#{proofCheck.rescind}"
                                        disabled="#{proofCheck.voucher.numberStatus != '2'}">
                            <h:graphicImage value="./images/chexiao.png" styleClass="pic" title="撤销" />
                        </h:commandLink>
                        <h:commandLink   action="#{proofCheck.getFirst}">
                            <h:graphicImage value="./images/btn_page_first.gif" styleClass="pic" title="首张" />
                        </h:commandLink>
                        <h:commandLink   action="#{proofCheck.previous}">
                            <h:graphicImage value="./images/btn_page_up.gif" styleClass="pic" title="上张" />
                        </h:commandLink>
                        <h:commandLink   action="#{proofCheck.next}">
                            <h:graphicImage value="./images/btn_page_down.gif" styleClass="pic" title="下张" />
                        </h:commandLink>
                        <h:commandLink   action="#{proofCheck.getLast}">
                            <h:graphicImage value="./images/btn_page_end.gif" styleClass="pic" title="末张" />
                        </h:commandLink>
                        <h:commandLink  action="#{proofCheck.toCata}">
                            <h:graphicImage value="./images/goback.png" styleClass="pic" title="返回" />
                        </h:commandLink>

                    </rich:toolbarGroup>
                </rich:toolbar>

                <fieldset class="demo_fieldset">
                    <legend class="demo_legend">支出证明单</legend>
                    <h:panelGrid columns="6" width="100%" border="0" id="voucher" styleClass="voucherGrid">

                        <h:outputLabel for="number" value="单据编号:" />
                        <h:outputText  id="number"  value="#{proofCheck.voucher.number}"  />

                        <h:outputLabel for="numDate" value="日期:" />
                        <h:outputText id="numDate" value="#{proofCheck.voucher.numDate}">
                            <f:convertDateTime pattern="yyyy年MM月dd日" timeZone="GMT+8"/>
                        </h:outputText>

                        <h:outputLabel for="affair" value="报销内容:"  />
                        <h:outputText  id="affair"   value="#{proofCheck.voucher.affair}" />

                        <h:outputLabel for="projName" value="预算项目名称:" />
                        <h:outputText  id="projName"   value="#{proofCheck.voucher.project.finName}" />

                        <h:outputLabel for="costItem" value="费用项目："/>
                        <h:outputText id ="costItem" value="#{proofCheck.voucher.feeItem.name}"/>

                        <h:outputLabel value="费用承担部门:" />
                        <h:outputText  id="payDept" value="#{proofCheck.voucher.payDept.name}"  />

                        <h:outputLabel value="经手人员:" />
                        <h:outputText  id="feePerson" value="#{proofCheck.voucher.feePer.cpsn_name}"  />


                        <h:outputLabel for="payWay" value="支付方式:"/>
                        <h:outputText id="payWay" value="#{proofCheck.voucher.payStyle.name}"/>

                        <h:outputLabel for="total1" value="费用总金额:"  />
                        <h:outputText  id="total1"  value="#{proofCheck.voucher.total}">
                            <f:convertNumber type="number" pattern="#,##0.00"/>
                        </h:outputText>

                        <h:outputLabel for="taxAmount" value="扣税金额:"  />
                        <h:outputText  id="taxAmount"   value="#{proofCheck.voucher.taxAmount}">
                            <f:convertNumber type="number" pattern="#,##0.00"/>
                        </h:outputText>

                        <h:outputLabel for="payable" value="待付金额:"  />
                        <h:outputText  id="payable"  value="#{proofCheck.voucher.total - proofCheck.voucher.taxAmount}">
                            <f:convertNumber type="number" pattern="#,##0.00"/>
                        </h:outputText>

                        <h:outputLabel for="department" value="部门名称:" />
                        <h:outputText  id="department"   value="#{proofCheck.voucher.dept.name}"  />

                        <h:outputLabel for="cpsn_name" value="制单人:" />
                        <h:outputText  id="cpsn_name"   value="#{proofCheck.voucher.user.cpsn_name}"  />

                        <h:inputHidden id="projCode" value="#{proofCheck.voucher.project.finCode}"/>
                    </h:panelGrid>
                </fieldset>
                <fieldset class="demo_fieldset">
                    <legend class="demo_legend">支出证明单审核</legend>
                    <h:panelGrid columns="4" width="100%" border="0" id="checkInfo" >
                        <h:outputLabel value="核定金额:"  />
                        <h:inputText  id="totalnew"   size="28" value="#{proofCheck.voucher.checkaccount}"
                                      disabled="#{proofCheck.voucher.numberStatus != '0'}">
                            <f:convertNumber type="number" pattern="#,##0.00"/>
                        </h:inputText>
                        <h:outputLabel value="经济分类:"  />
                        <h:inputText  id="costname"   size="28"  value="#{proofCheck.voucher.costitem.name}"
                                      onclick="showCostItem()" disabled="#{proofCheck.voucher.numberStatus != '0'}"/>
                        <h:outputText value="预算来源："  />
                        <h:selectOneRadio   value="#{proofCheck.voucher.budgetSource}"
                                            disabled="#{proofCheck.voucher.numberStatus != '0'}">
                            <f:selectItem itemLabel="当年预算" itemValue="当年预算"/>
                            <f:selectItem itemLabel="上年结余" itemValue="上年结余"/>
                        </h:selectOneRadio>
                        <h:outputText value="支出类别:" />
                        <h:selectOneRadio value="#{proofCheck.voucher.costClass}"
                                          disabled="true">
                            <f:selectItem itemLabel="基本支出" itemValue="0"/>
                            <f:selectItem itemLabel="项目支出" itemValue="1"/>
                        </h:selectOneRadio>
                        <h:outputText value="支出渠道:" />
                        <h:selectOneMenu  id="costType" value="#{proofCheck.voucher.costTypes.code}"
                                          style=" width: 198px;" disabled="#{proofCheck.voucher.numberStatus != '0'}">
                            <f:selectItem itemValue=" " itemLabel="-请选择-"/>
                            <f:selectItems value="#{class.selectItemList}" />
                        </h:selectOneMenu>
                        <a4j:commandButton value="支付令:" render="paycode"  action="#{proofCheck.buildPaycode}"
                                           disabled="#{proofCheck.voucher.numberStatus != '0'}"/>
                        <h:inputText  id="paycode" size="28"  value="#{proofCheck.voucher.paycode}"
                                      disabled="#{proofCheck.voucher.numberStatus != '0'}"/>
                    </h:panelGrid>
                    <hr/>
                    <h:panelGrid columns="2" width="100%" columnClasses="col1,col2">
                        <h:outputLabel value="审核意见:"/>
                        <h:inputTextarea value="#{proofCheck.voucher.checkInfo}" cols="100" disabled="#{proofCheck.voucher.numberStatus != '0'}"/>
                    </h:panelGrid>
                    <hr/>
                    <h:panelGrid columns="4" width="100%" border="0" columnClasses="col1,col2,col1,col2">
                        <h:outputLabel value="审核人:" />
                        <h:outputText value="#{proofCheck.voucher.auditor}"/>
                        <h:outputLabel value="审核日期:" />
                        <h:outputText value="#{proofCheck.voucher.auditDate}">
                            <f:convertDateTime pattern="yyyy年MM月dd日"/>
                        </h:outputText>
                    </h:panelGrid>
                </fieldset>
            </rich:panel>
        </h:form>
    </h:body>
</html>
